package edu.upenn.seas.peerreview.pr

import edu.upenn.seas.peerreview.Message

object PRMessages {
  
  // Do these need to be globally known, or does only PR care about this? -clu
  type Hash = Int //For now
  type SeqNum = Int// For now
  type Signature =String//For now  

  //Internal PR Messages
  abstract class PRMessage extends Message
  abstract class LogMessage 

  case class LOG_SEND(to: Id, msg: Message) extends LogMessage
  case class LOG_RECV(from: Id, msg: Message, seqSend: SeqNum) extends LogMessage
  case class LOG_ACK(to:Id, seq1:SeqNum, seq2:SeqNum, hashPrec:Hash, sig:Signature, hash:Hash) extends LogMessage
  case class LOG_SSIGN(sig:Signature) extends LogMessage
  case class LOG_RSIGN(hash:Hash, sig:Signature) extends LogMessage
  case class LOG_INIT() extends LogMessage

  //PR - PR Messages
  case class PleaseSendYourLog () extends PRMessage
  case class HereIsMyLog (l:Log) extends PRMessage
  
  // PR - PR Wrapper Messages
  case class PR_SEND(msg: Message, seq: SeqNum) extends PRMessage
}
